package com.mapforge.map;

import com.mapforge.selection.Selection;
import com.mapforge.selection.SetOperationType;

/**
 * The {@link NullMask} class is a {@link Mask} using a Null Design Pattern (see
 * http://en.wikipedia.org/wiki/Null_Object_pattern). Its functions consider all
 * cells in a matrix valid for operations. All other methods do nothing.
 * 
 * @see Mask
 * @author Will Morrison
 */
public class NullMask implements Mask {
	private int width;
	private int height;

	public NullMask() {
		this(0, 0);
	}

	public NullMask(int width, int height) {
		this.width = width;
		this.height = height;
	}

	/**
	 * Does nothing. See class description.
	 * 
	 * @see NullMask
	 */
	public void clearMask() {
		// intentionally left empty
	}

	/**
	 * Does nothing. See class description.
	 * 
	 * @see NullMask
	 */
	public void setValues(Selection selection, long value) {
		// intentionally left empty
	}

	/**
	 * Always returns true. {@link NullMask} considers all cells within matrix
	 * valid for operations. See class description.
	 */
	public boolean checkMask(int x, int y, long value) {
		return true;
	}

	@Override
	public void setValues(SetOperationType type, Selection selection, long value) {
		// intentionally left empty
	}

	@Override
	public int getHeight() {
		return height;
	}

	@Override
	public int getWidth() {
		return width;
	}
}
